﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using STLGROUP.Layers.Presentations.FormBase;
using STLGROUP.Layers.Common;

namespace QuanLyBanHang
{
    /// <summary>
    /// CF002 - Danh mục tỉnh thành
    /// </summary>
    public partial class CF002 : frmCatalogBase
    {
        public CF002()
        {
            InitializeComponent();
        }

        protected override void LoadData()
        {
            this._bindingSource.DataSource = Cache.Context.DM_TinhThanh;
            this.dgvTinhThanh.DataSource = _bindingSource;

            base.LoadData();
        }

        protected override void AddDataBinding()
        {
            txtMaTinhThanh.DataBindings.Add(Const.BIND_TEXT, _bindingSource, "MaTinhThanh", true);
            txtTenTinhThanh.DataBindings.Add(Const.BIND_TEXT, _bindingSource, "TenTinhThanh", true);

            base.AddDataBinding();
        }

        protected override void AddNew()
        {
            base.AddNew();
            txtMaTinhThanh.Focus();
        }
    }
}
